package AcWing;

import java.math.BigInteger;
import java.util.Scanner;

/**
 * @author ZhuYi
 * @create 2025/4/9 22:33
 */
public class 高精度加减乘除 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        BigInteger a = new BigInteger(sc.nextLine());
        BigInteger b = new BigInteger(sc.nextLine());
//        System.out.println(a.add(b));//加法
//        System.out.println(a.subtract(b));//减法
//        System.out.println(a.multiply(b));//乘法
        System.out.println(a.divideAndRemainder(b)[0]);//除法0是商1是余
        System.out.println(a.mod(b));//取余
    }
}
